From 8874ef8c82454b3dced8b9bba1ead4da556af27e Mon Sep 17 00:00:00 2001 From: "kaf24@firebug.cl.cam.ac.uk" Date: Tue, 10 May 2005 10:53:32 +0000 Subject: [PATCH] bitkeeper revision 1.1389.5.45 (428092ac-yDbfUH2hZkDdl0sU-Sv8Q) Various cleanups. Signed-off-by: Keir Fraser --- xen/arch/x86/io_apic.c | 37 +------------------------------ xen/arch/x86/mtrr/main.c | 1 + xen/arch/x86/traps.c | 5 +++-- xen/arch/x86/x86_32/asm-offsets.c | 2 +- xen/arch/x86/x86_32/mm.c | 2 +- xen/arch/x86/x86_64/mm.c | 2 +- xen/include/asm-x86/fixmap.h | 23 +------------------ 7 files changed, 9 insertions(+), 63 deletions(-) diff --git a/xen/arch/x86/io_apic.c b/xen/arch/x86/io_apic.c index 929117c95c..3e7c89cf0e 100644 --- a/xen/arch/x86/io_apic.c +++ b/xen/arch/x86/io_apic.c @@ -1233,7 +1233,6 @@ static inline void UNEXPECTED_IO_APIC(void) void __init print_IO_APIC(void) { -#ifndef NDEBUG int apic, i; union IO_APIC_reg_00 reg_00; union IO_APIC_reg_01 reg_01; @@ -1377,7 +1376,7 @@ void __init print_IO_APIC(void) } printk(KERN_INFO ".................................... done.\n"); -#endif /* !NDEBUG */ + return; } @@ -1830,26 +1829,6 @@ static struct hw_interrupt_type lapic_irq_type = { .end = end_lapic_irq }; -#if 0 -static void setup_nmi (void) -{ - /* - * Dirty trick to enable the NMI watchdog ... - * We put the 8259A master into AEOI mode and - * unmask on all local APICs LVT0 as NMI. - * - * The idea to use the 8259A in AEOI mode ('8259A Virtual Wire') - * is from Maciej W. Rozycki - so we do not have to EOI from - * the NMI handler or the timer interrupt. - */ - apic_printk(APIC_VERBOSE, KERN_INFO "activating NMI Watchdog ..."); - - on_each_cpu(enable_NMI_through_LVT0, NULL, 1, 1); - - apic_printk(APIC_VERBOSE, " done.\n"); -} -#endif - /* * This looks a bit hackish but it's about the only one way of sending * a few INTA cycles to 8259As and any associated glue logic. ICR does @@ -1953,14 +1932,6 @@ static inline void check_timer(void) */ unmask_IO_APIC_irq(0); if (timer_irq_works()) { -#if 0 - if (nmi_watchdog == NMI_IO_APIC) { - disable_8259A_irq(0); - setup_nmi(); - enable_8259A_irq(0); - check_nmi_watchdog(); - } -#endif return; } clear_IO_APIC_pin(0, pin1); @@ -1980,12 +1951,6 @@ static inline void check_timer(void) replace_pin_at_irq(0, 0, pin1, 0, pin2); else add_pin_to_irq(0, 0, pin2); -#if 0 - if (nmi_watchdog == NMI_IO_APIC) { - setup_nmi(); - check_nmi_watchdog(); - } -#endif return; } /* diff --git a/xen/arch/x86/mtrr/main.c b/xen/arch/x86/mtrr/main.c index 02b4b46004..b7c4713c69 100644 --- a/xen/arch/x86/mtrr/main.c +++ b/xen/arch/x86/mtrr/main.c @@ -34,6 +34,7 @@ #include #include #include +#include #include #include #include diff --git a/xen/arch/x86/traps.c b/xen/arch/x86/traps.c index bdb15968bb..52bd64ac9b 100644 --- a/xen/arch/x86/traps.c +++ b/xen/arch/x86/traps.c @@ -115,7 +115,8 @@ asmlinkage void fatal_trap(int trapnr, struct cpu_user_regs *regs) if ( trapnr == TRAP_page_fault ) { __asm__ __volatile__ ("mov %%cr2,%0" : "=r" (cr2) : ); - printk("Faulting linear address might be %p\n", _p(cr2)); + printk("Faulting linear address: %p\n", _p(cr2)); + show_page_walk(cr2); } printk("************************************\n"); @@ -349,7 +350,7 @@ asmlinkage int do_page_fault(struct cpu_user_regs *regs) show_page_walk(addr); panic("CPU%d FATAL PAGE FAULT\n" "[error_code=%04x]\n" - "Faulting linear address might be %p\n", + "Faulting linear address: %p\n", smp_processor_id(), regs->error_code, addr); return 0; } diff --git a/xen/arch/x86/x86_32/asm-offsets.c b/xen/arch/x86/x86_32/asm-offsets.c index b440b0501e..7015b2a861 100644 --- a/xen/arch/x86/x86_32/asm-offsets.c +++ b/xen/arch/x86/x86_32/asm-offsets.c @@ -90,7 +90,7 @@ void __dummy__(void) OFFSET(MULTICALL_result, multicall_entry_t, args[5]); BLANK(); - DEFINE(FIXMAP_apic_base, __fix_to_virt(FIX_APIC_BASE)); + DEFINE(FIXMAP_apic_base, fix_to_virt(FIX_APIC_BASE)); BLANK(); DEFINE(IRQSTAT_shift, LOG_2(sizeof(irq_cpustat_t))); diff --git a/xen/arch/x86/x86_32/mm.c b/xen/arch/x86/x86_32/mm.c index e88195a8e1..045d904c21 100644 --- a/xen/arch/x86/x86_32/mm.c +++ b/xen/arch/x86/x86_32/mm.c @@ -83,7 +83,7 @@ void __set_fixmap( { if ( unlikely(idx >= __end_of_fixed_addresses) ) BUG(); - map_pages(idle_pg_table, __fix_to_virt(idx), p, PAGE_SIZE, flags); + map_pages(idle_pg_table, fix_to_virt(idx), p, PAGE_SIZE, flags); } diff --git a/xen/arch/x86/x86_64/mm.c b/xen/arch/x86/x86_64/mm.c index 3becac2024..a1db5acd05 100644 --- a/xen/arch/x86/x86_64/mm.c +++ b/xen/arch/x86/x86_64/mm.c @@ -125,7 +125,7 @@ void __set_fixmap( { if ( unlikely(idx >= __end_of_fixed_addresses) ) BUG(); - map_pages(idle_pg_table, __fix_to_virt(idx), p, PAGE_SIZE, flags); + map_pages(idle_pg_table, fix_to_virt(idx), p, PAGE_SIZE, flags); } diff --git a/xen/include/asm-x86/fixmap.h b/xen/include/asm-x86/fixmap.h index d2d8ef183e..c70b2a8b01 100644 --- a/xen/include/asm-x86/fixmap.h +++ b/xen/include/asm-x86/fixmap.h @@ -56,28 +56,7 @@ extern void __set_fixmap( #define __fix_to_virt(x) (FIXADDR_TOP - ((x) << PAGE_SHIFT)) #define __virt_to_fix(x) ((FIXADDR_TOP - ((x)&PAGE_MASK)) >> PAGE_SHIFT) -extern void __this_fixmap_does_not_exist(void); - -/* - * 'index to address' translation. If anyone tries to use the idx - * directly without translation, we catch the bug with a NULL-deference - * kernel oops. Illegal ranges of incoming indices are caught too. - */ -static always_inline unsigned long fix_to_virt(const unsigned int idx) -{ - /* - * This branch gets completely eliminated after inlining, except when - * someone tries to use fixaddr indices in an illegal way (such as mixing - * up address types or using out-of-range indices). - * - * If it doesn't get removed, the linker will complain loudly with a - * reasonably clear error message. - */ - if (idx >= __end_of_fixed_addresses) - __this_fixmap_does_not_exist(); - - return __fix_to_virt(idx); -} +#define fix_to_virt(x) (__fix_to_virt(x)) static inline unsigned long virt_to_fix(const unsigned long vaddr) { -- 2.30.2